using UnityEngine;

public class UIScreenController : MonoBehaviour
{
	public static UIScreenController instance;

	private UIScreenType previousScreenType;

	private UIScreenType currentScreenType;

	private GameObject openedScreen;

	public GameObject firstScreen;

	public GameObject menuScreen;

	public GameObject gameScreen;

	public GameObject screenshotScreen;

	public GameObject skinsScreen;

	public GameObject congratsScreen;

	public UIScreenType PreviousScreenType
	{
		get
		{
			return previousScreenType;
		}
	}

	public UIScreenType CurrentScreenType
	{
		get
		{
			return currentScreenType;
		}
	}

	private void Awake()
	{
		if (instance == null)
		{
			instance = this;
		}
		else if (instance != this)
		{
			Object.Destroy(base.gameObject);
		}
	}

	private void Start()
	{
		OpenMenu();
	}

	public void ChangeCanvas(UIScreenType type, GameObject screenObject)
	{
		previousScreenType = currentScreenType;
		currentScreenType = type;
		if (openedScreen != null)
		{
			openedScreen.SetActive(false);
		}
		screenObject.SetActive(true);
		openedScreen = screenObject;
	}

	public void OpenMenu()
	{
		ChangeCanvas(UIScreenType.Menu, menuScreen);
	}

	public void OpenFirst()
	{
		ChangeCanvas(UIScreenType.First, firstScreen);
	}

	public void OpenGame()
	{
		ChangeCanvas(UIScreenType.Game, gameScreen);
	}

	public void OpenScreenshot()
	{
		ChangeCanvas(UIScreenType.Screenshot, screenshotScreen);
	}

	public void OpenSkins()
	{
		MyAdManager.Instance.MyShowNative();
		ChangeCanvas(UIScreenType.Skins, skinsScreen);
	}

	public void OpenCongrats()
	{
		ChangeCanvas(UIScreenType.Congrats, congratsScreen);
	}
}
